package com.zb.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.entity.ZjUserContact;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/8/10 0010
 **/
@Data
@ApiModel("用户联系人列表对象")
public class UserContactListVo {
    @ApiModelProperty(value = "联系人ID")
    private Long id;

    @ApiModelProperty(value = "是否为主要联系人：false-否，true-是")
    private Boolean mainContact;

    @ApiModelProperty(value = "用户名称")
    private String username;

    @ApiModelProperty(value = "用户手机号")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "地址-省")
    private String province;

    @ApiModelProperty(value = "地址-市")
    private String city;

    @ApiModelProperty(value = "地址-县/区")
    private String area;

    @ApiModelProperty(value = "地址-镇")
    private String town;

    @ApiModelProperty(value = "地址-详细地址")
    private String address;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static UserContactListVo beanToVo(ZjUserContact contact) {
        UserContactListVo vo = new UserContactListVo();
        BeanUtils.copyProperties(contact, vo);
        vo.setCreateTime(contact.getGmtCreate());
        vo.setUpdateTime(contact.getGmtUpdate());
        return vo;
    }
}
